package com.smy.service;

import com.github.pagehelper.PageInfo;
import com.smy.dto.UserDto;
import com.smy.pojo.Role;
import com.smy.pojo.User;

import java.util.List;

/**
 *
 * user操作
 */

public interface IUserService {
    List<User> query(User user)throws Exception;
    Integer addUser(User user)throws Exception;
    Integer updateUser(User user)throws Exception;
    Integer deleteUser(Integer id)throws Exception;

    Integer saveOrUpdate(UserDto userDto)throws Exception;

    User queryById(Integer userId);

    List<Integer> queryUserRoleIds(Integer userId);

    PageInfo<User> queryByPage(UserDto dto) throws Exception;

    User login(String username);
    List<Role> queryUserHaveRole(User user);

    List<User> queryUserByRoleName(String roleSaleman);
}
